package com.lx.web;

import com.lx.entity.Book;
import com.lx.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class myBookServlet {

    @Autowired
    private BookService bookService;

    //用户借阅图书
    @RequestMapping("/myBook")
    public String myBook(int user_id,int book_id){
        bookService.myBook(user_id,book_id);
        return "redirect:/bookList";
    }

    //用户归还图书
    @RequestMapping("/noMyBook")
    public String noMyBook(int book_id){
        bookService.noMyBook(book_id);
        return "redirect:/bookList";
    }
}
